import { Route, RouteProps, Redirect } from 'react-router-dom';
import {ComponentType} from "react";
interface PrivateRouteProps extends RouteProps  {
    component: ComponentType<any>
}
const IS_LOGIN=true;
export default function PrivateRoute (props:PrivateRouteProps ){
    const {component:Component, ...rest}=props;
    return IS_LOGIN? <Route {...rest} render={props => <Component {...props} />}/>:<Redirect to="/login" />
}
